package com.situ.personal.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/department")
public class DepartmentServlet extends HttpServlet{

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		//req.setCharacterEncoding("UTF-8");
		
		String method = req.getParameter("method");
		// 如果没有传递method让他的默认值是"findByPage"
		if (method == null || "".equals(method)) {
			method = "findByPage";
		}
		
		switch (method) {
		case "findByPage":
			findByPage(req, resp);
			break;

		default:
			break;
		}
	}

	private void findByPage(HttpServletRequest req, HttpServletResponse resp) {
		System.out.println("DepartmentServlet.findByPage()");
	}
}
